package org.htmlparser.filters;

import org.htmlparser.Node;
import org.htmlparser.NodeFilter;
import org.htmlparser.tags.LinkTag;

public class LinkStringFilter
  implements NodeFilter
{
  static Class class$org$htmlparser$tags$LinkTag;
  protected boolean mCaseSensitive;
  protected String mPattern;

  public LinkStringFilter(String paramString)
  {
    this(paramString, false);
  }

  public LinkStringFilter(String paramString, boolean paramBoolean)
  {
    this.mPattern = paramString;
    this.mCaseSensitive = paramBoolean;
  }

  static Class class$(String paramString)
  {
    Class localClass;
    try
    {
      localClass = Class.forName(paramString);
      return localClass;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError().initCause(localClassNotFoundException);
    }
  }

  public boolean accept(Node paramNode)
  {
    Class localClass;
    String str;
    int i = 0;
    if (class$org$htmlparser$tags$LinkTag == null)
    {
      localClass = class$("org.htmlparser.tags.LinkTag");
      class$org$htmlparser$tags$LinkTag = localClass;
      if (localClass.isAssignableFrom(paramNode.getClass()))
      {
        str = ((LinkTag)paramNode).getLink();
        if (!(this.mCaseSensitive))
          break label70;
        if (str.indexOf(this.mPattern) > -1)
          i = 1;
      }
    }
    while (true)
    {
      label70: 
      do
        while (true)
        {
          return i;
          localClass = class$org$htmlparser$tags$LinkTag;
        }
      while (str.toUpperCase().indexOf(this.mPattern.toUpperCase()) <= -1);
      i = 1;
    }
  }
}